"use client";
import { useQuery } from "@tanstack/react-query";
import { useAuth } from "@/components/auth/auth-provider";
const TestPage = () => {
  const { user } = useAuth();

  const { isPending, error, data } = useQuery({
    queryKey: ["task"],
    queryFn: () =>
      fetch(`/api/task/pagination?page=0&size=10&userId=${user?.id}`, {
        method: "GET",
        headers: { "Content-Type": "application/json" },
      }).then((res) => {
        console.log("test query", res);
        return res.json();
      }),
  });
  if (isPending || error) return <div>loading... {`${isPending}${error}`}</div>;
  return <div className="fle ">{JSON.stringify(data)}</div>;
};
export default TestPage;
